part of '../controller.dart';

class _PendingOrderPlacingResultDto extends Equatable implements _OrderPlacingResultDto {
  const _PendingOrderPlacingResultDto._internal({
    required this.confirmationUrl,
  });

  final String confirmationUrl;

  @override
  List<Object?> get props {
    return [
      confirmationUrl,
    ];
  }

  factory _PendingOrderPlacingResultDto.fromEntity(
      PendingYookassaOrderPlacingResult orderPlacingResult) {
    return _PendingOrderPlacingResultDto._internal(
      confirmationUrl: orderPlacingResult.confirmationUrl,
    );
  }

  @override
  Map<String, dynamic> toJson() {
    return {
      _kOrderPlacingResultPaymentStatusKey: 'pending',
      'confirmation_url': confirmationUrl,
    };
  }
}
